﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using IService.Data;
using IService.Model;
using IService.DataDLL;

namespace IService.Business.Manager
{
    public class SupplyPurchaseManager
    {
        public DataTable GetSupplyPurchaseListAll()
        {
            return DTVData.SupplyPurchaseManager.GetSupplyPurchaseListAll(typeof(SupplyPurchase));
        }

        public DataTable GetLatestSupplyPurchaseList(int supplyPurchasenum, string whereClause)
        {
            return DTVData.SupplyPurchaseManager.GetLatestSupplyPurchaseList(typeof(SupplyPurchase), supplyPurchasenum, whereClause);
        }

        public DataTable GetLatestSupplyPurchaseListByType(int supplyPurchasenum, int type)
        {
            return DTVData.SupplyPurchaseManager.GetLatestSupplyPurchaseListByType(typeof(SupplyPurchase), supplyPurchasenum, type);
        }

        public DataTable GetSupplyPurchaseListPagin(PagingEntity pe)
        {
            return DTVData.SupplyPurchaseManager.GetSupplyPurchaseListPagin(typeof(SupplyPurchase), pe);
        }

        public SupplyPurchase GetSupplyPurchaseById(int Id)
        {
            SupplyPurchase supplyPurchase = new SupplyPurchase();
            supplyPurchase.ID = Id;
            return DTVData.SupplyPurchaseManager.GetSupplyPurchaseById(supplyPurchase);
        }
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="supplyPurchase"></param>
        /// <returns></returns>
        public bool InsertSupplyPurchase(SupplyPurchase supplyPurchase)
        {
            return DTVData.SupplyPurchaseManager.InsertSupplyPurchase(supplyPurchase);
        }

        public bool UpdateSupplyPurchase(SupplyPurchase supplyPurchase)
        {
            return DTVData.SupplyPurchaseManager.UpdateSupplyPurchase(supplyPurchase);
        }

        public bool DeleteSupplyPurchase(int Id)
        {
            SupplyPurchase supplyPurchase = new SupplyPurchase();
            supplyPurchase.ID = Id;
            return DTVData.SupplyPurchaseManager.DeleteSupplyPurchase(supplyPurchase);
        }

        public bool DeleteSupplyPurchaseByIds(string Ids)
        {
            return DTVData.SupplyPurchaseManager.DeleteSupplyPurchaseByIds(typeof(SupplyPurchase), Ids);
        }
    }
}
